
#ifndef _APDU_LIB_CRYPTION_MGR_H_
#define _APDU_LIB_CRYPTION_MGR_H_

#include "../apdu.def/apdu_datatypes.h"


#ifdef __cplusplus
extern "C" {
#endif
	
	int app_encrypt_init(HANDLE devHandle, int app_id, int container_id, unsigned long key_id, 
						unsigned char * iv, int iv_len, unsigned long padding_type, unsigned long feed_bit_len);


	int app_encrypt(HANDLE devHandle, int app_id, int container_id, unsigned long key_id, 
						unsigned char * input, int input_len, unsigned char * output, int *output_len);

	int app_encrypt_update(HANDLE devHandle, int app_id, int container_id, unsigned long key_id,
						unsigned char * input, int input_len, unsigned char * output, int * output_len);

	int app_encrypt_update_hs(HANDLE devHandle, unsigned long algo_id, 
								int appid, int containerId, int keyId,
								int firstPackage, unsigned char * iv, int iv_len,
								unsigned char * input, int input_len, unsigned char * output, int *output_len);

	int app_encrypt_final(HANDLE devHandle, int app_id, int container_id, unsigned long key_id, 
						unsigned char * input, int input_len, unsigned char * output, int * output_len);


	int app_decrypt_init(HANDLE devHandle, int app_id, int container_id, unsigned long key_id, 
						unsigned char * iv, int iv_len, unsigned long padding_type, unsigned long feed_bit_len);


	int app_decrypt(HANDLE devHandle, int app_id, int container_id, unsigned long key_id, 
						unsigned char * input, int input_len, unsigned char * output, int * output_len);

	int app_decrypt_update_hs(HANDLE devHandle, int algo_id, 
						int appid, int containerId, int keyId,
						int firstPackage, unsigned char * iv, int iv_len,
						unsigned char * input, int input_len, unsigned char * output, int *output_len);
	
	int app_decrypt_update(HANDLE devHandle, int app_id, int container_id, unsigned long key_id,
						unsigned char * input, int input_len, unsigned char * output, int * output_len);


	int app_decrypt_final(HANDLE devHandle, int app_id, int container_id, unsigned long key_id, 
						unsigned char * input, int input_len, unsigned char * output, int * output_len);


	

#ifdef __cplusplus
}
#endif

#endif
